home *** CD-ROM | disk | other *** search
/ SGI ONC3 NFS v2 / SGI ONC3 NFS v2.iso / dist6.4 / nfs.idb / var / yp / .yp.inst.sh.z / .yp.inst.sh (.txt)
Linux/UNIX/POSIX Shell Script  |  1997-02-07  |  3KB  |  99 lines

  1. #!/bin/sh
  2. # set -xv
  3. # This shell script moves all the configuration scripts and
  4. # YP databases from /usr/etc/yp to their new location, in
  5. # /var/yp.  It is executed as part of the inst for YP.
  6. #
  7. # This script also deletes all the binaries (e.g., ypxfr) that 
  8. # are now located in /usr/sbin.  Note that shell scripts and
  9. # executables that remain (e.g., make.script) may be overwritten 
  10. # during the inst.
  11. #
  12. # This script will not do the move if if /var/yp/ypdomain exists.
  13. #
  14. # Note:
  15. #   inst will create the directory /var/yp and copy this script
  16. #   there before executing it.
  17. #
  18. #   The install also creates a symlink from /usr/etc/yp to /var/yp.
  19. #   When that happens, the existing /usr/etc/yp will be renamed
  20. #   to /usr/etc/yp.O.  Thus, this script looks there for existing
  21. #   configuration files.
  22. #   We know that the symlink will be created before this file
  23. #   executes since the entries in the idb file are processed
  24. #   alphabetically, (and /usr/etc/yp is before /var/yp.)
  25. if [ -f $rbase/var/yp/ypdomain ]
  26. then :
  27. else
  28.     if [ -d $rbase/usr/etc/yp.O -o -l $rbase/usr/etc/yp.O ]
  29.     then
  30.         echo "moving contents of" $rbase/usr/etc/yp.O "to" $rbase/var/yp
  31.         cd $rbase/usr/etc/yp.O
  32.  
  33. #    Copy any subdirectories that may be in /usr/etc/yp.O
  34. #    and then move the files.
  35.         for i in `find . -type d -print`; do
  36.             mkdir -p $rbase/var/yp/$i > /dev/null 2>&1
  37.         done
  38.         for i in `find . ! -type d -print`; do
  39.         mv $i $rbase/var/yp/$i
  40.     done
  41.  
  42. #    Now delete the subdirectories and /usr/etc/yp.O itself.
  43.     rmdir * > /dev/null 2>&1
  44.     cd /
  45.     rmdir $rbase/usr/etc/yp.O > /dev/null 2>&1
  46.  
  47.         if [ -f $rbase/var/yp/makedbm ] 
  48.     then rm $rbase/var/yp/makedbm 
  49.     fi
  50.         if [ -f $rbase/var/yp/mkalias ] 
  51.     then rm $rbase/var/yp/mkalias 
  52.     fi
  53.         if [ -f $rbase/var/yp/mknetid ] 
  54.     then rm $rbase/var/yp/mknetid 
  55.     fi
  56.         if [ -f $rbase/var/yp/registrar ] 
  57.     then rm $rbase/var/yp/registrar 
  58.     fi
  59.         if [ -f $rbase/var/yp/revnetgroup ] 
  60.     then rm $rbase/var/yp/revnetgroup 
  61.     fi
  62.         if [ -f $rbase/var/yp/stdhosts ] 
  63.     then rm $rbase/var/yp/stdhosts 
  64.     fi
  65.         if [ -f $rbase/var/yp/updbootparam ] 
  66.     then rm $rbase/var/yp/updbootparam 
  67.     fi
  68.         if [ -f $rbase/var/yp/stdhosts ] 
  69.     then rm $rbase/var/yp/stdhosts 
  70.     fi
  71.         if [ -f $rbase/var/yp/updbootparam ] 
  72.     then rm $rbase/var/yp/updbootparam 
  73.     fi
  74.         if [ -f $rbase/var/yp/yp_bootparam ] 
  75.     then rm $rbase/var/yp/yp_bootparam 
  76.     fi
  77.         if [ -f $rbase/var/yp/yp_host ] 
  78.     then rm $rbase/var/yp/yp_host 
  79.     fi
  80.         if [ -f $rbase/var/yp/ypmapname ] 
  81.     then rm $rbase/var/yp/ypmapname 
  82.     fi
  83.         if [ -f $rbase/var/yp/yppoll ] 
  84.     then rm $rbase/var/yp/yppoll 
  85.     fi
  86.         if [ -f $rbase/var/yp/yppush ] 
  87.     then rm $rbase/var/yp/yppush 
  88.     fi
  89.         if [ -f $rbase/var/yp/ypset ] 
  90.     then rm $rbase/var/yp/ypset 
  91.     fi
  92.         if [ -f $rbase/var/yp/ypxfr ] 
  93.     then rm $rbase/var/yp/ypxfr 
  94.     fi
  95.     fi
  96. fi
  97. rm $rbase/var/yp/.yp.inst.sh
  98.